<%--
 *  File:    ProductGroupEdit.jsp
 *  @Author: Jamesli 
 *  Date:    2010/12/30
 *
 *  Copyright (C) 2000 - 2010 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>     
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<% //--------------------------------------  setting logger --%>
<%
  	Category cat = Category.getInstance("jsp.ProductGroupEdit");    
%>

<% //--------------------------------------  variant and initialization --%>
<%
  	String strModuleName = "COM";
  	String privilegeCode = "10212";
    String contextPath = request.getContextPath();
%>

<% //--------------------------------------  include files list --%>
<%@ include file="/inc/Security.inc" %>
<%@ include file="/inc/PageDefault.inc" %>

<html>
<head>
<title>ProductGroupEdit</title>
<PageFlow:CheckPageFlow pageName="p_productgroupedit"/>  
<%@ include file="/inc/CatchError.inc" %>
<%@ include file="/inc/InitEdit.inc" %>

<% //--------------------------------------  output variant from pageflow --%>
<%
	boolean readOnly = false;
	HashMap productGroup = (HashMap)pageContext.getAttribute("productgroup");
	if(productGroup == null) productGroup = new HashMap();
	Integer productGroupId = (Integer)productGroup.get("productgroupid");
	if(null != productGroupId) readOnly = true;
%>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%= contextPath%>/css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="<%= contextPath%>/js/ScriptLib.js"></script>
<script language="JavaScript">
function page_done()
{ 
  	if(!checkForm(document.cform))
  		return;
  	document.cform.actionname.value = "done";
  	isRunning = true;
  	cform.target = "_parent";
  	document.cform.submit();
}
function popWindowsGroupSuit(){
	if ((cform.productgroupid.value==null)||(cform.productgroupid.value.length <= 0)||(cform.productgroupid.value=="null")){
	
	
    	alert("<%=message.getMessageDesc("SAVE_INFO_FIRST")%>");
    	
        return;
    }
	var productgroupid = cform.productgroupid.value;
	var url = "";
	if (cform.status.value==41){
     url = "zylGroupSuitPopWindow.jsp?"+"<%= OvalTools.randomURL() %>"+"&productgroupid="+productgroupid+"&isview="+"2";
     }
   else {
     url = "zylGroupSuitPopWindow.jsp?"+"<%= OvalTools.randomURL() %>"+"&productgroupid="+productgroupid+"&isview="+"1";
    }
	
	var windowAttribute = "height=400, width=600,top=100,left=100, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=yes";
	if(popwindow!=null) popwindow.close();
 	popwindow = window.open(url,null,windowAttribute);
 	
}

</script>
</head>

<body>
	
	<% //--------------------------------------  hidden form variant --%>
	<form name="cform" method="post" action="<%= contextPath%>/Dispatcher" target="_parent">	
    <input type="hidden" name="pagename" value="p_productgroupedit">
    <input type="hidden" name="actionname">
    <input type="hidden" name="viewflag">
    <custom:hidden property="grade" name="productgroup"/>
    <custom:hidden property="isbottom" name="productgroup"/>
    <custom:hidden property="productgroupid" name="productgroup"/>
    <custom:hidden property="orgid" name="productgroup"/>
	<table width="100%" cellspacing="0" border="0" cellpadding="0">
  	<tr> 
    	<td> 
      		<table width="100%" cellspacing="0" cellpadding="0">
        	<tr> 
          		<td colspan="2" class="summary_top"></td>
        	</tr>
        	<tr> 
          		<td colspan="2"><img src="<%= contextPath%>/images/<%= strLanguageCode %>/quote.gif" width="16" height="11"> 
            		<%= label.getLabelName("L_NEGroup") + label.getLabelName("L_Colon") %></td>
        	</tr>
      		</table>
      		
      		<table width="100%" border="1" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0" align="center">
        	<tr> 
          		<td class="need" width="110"><%= label.getLabelName("L_GroupCode") + label.getLabelName("L_Colon") %></td>
          		<td> 
            		<custom:write property="productgroupcode" name="productgroup" nbsp="true"/>
          		</td>
          		<td class="need" width="110"><%= label.getLabelName("L_GroupName") + label.getLabelName("L_Colon") %></td>
          		<td> 
          			<custom:text property="productgroupname" name="productgroup" command="notnull" label="L_GroupName"/>
          		</td>
        	</tr>
        	<tr> 
          		<td class="need" width="110"><%= label.getLabelName("L_Status") + label.getLabelName("L_Colon") %></td>
          		<td>
            		<custom:selectdic dictType="Status" property="status" name="productgroup" command="notnull" label="L_Status" valueCriteria="41,28" sortOrder="desc" />
          		</td>
          		<td class="td-text" width="110"><%= label.getLabelName("L_Description") + label.getLabelName("L_Colon") %> </td>
          		<td>
          			<custom:text property="description" name="productgroup" style="width:450px;"/>
          		</td>
        	</tr>
        	<tr> 
          		<td class="need" width="110"><%= label.getLabelName("L_Type") + label.getLabelName("L_Colon") %> </td>
          		<td>
          			<custom:selectdic dictType="ZylBusinessType" property="grouptype" name="productgroup" command="notnull" label="L_Type" defaultValue="----" defaultValueCost=" "/>
          		</td>
          		<td class="need" height="13" width="110"><%= label.getLabelName("L_SuitableUsers") + label.getLabelName("L_Colon") %></td>
          		<td><a onclick='popWindowsGroupSuit()'> <custom:button type="3"
					label="L_Asterisk" imgsrc="Time.gif" border="0" /></a>
<!--          			<custom:selectdic dictType="ZylGroupSuit" property="groupsuit" name="productgroup" command="notnull" label="L_SuitableUsers" defaultValue="------" defaultValueCost=" "/>-->
          		</td>
        	</tr>
        	<tr> 
          		<td class="td-text" width="110"><%= label.getLabelName("L_CreatDate") + label.getLabelName("L_Colon") %></td>
          		<td> 
          			&nbsp;<custom:write property="createdate" name="productgroup"/>
          		</td>
          		<td class="td-text" width="110"><%= label.getLabelName("L_LastModifyTime") + label.getLabelName("L_Colon") %></td>
          		<td> 
          			&nbsp;<custom:write property="datelastupdated" name="productgroup"/>
          		</td>
        	</tr>
        	
        	<tr> 
        	<td class="td-text" width="110"><%= label.getLabelName("L_NonLock") + label.getLabelName("L_Colon") %></td>
          		<td colspan="3"> 
          		<custom:selectdic name="productgroup" property="isnolock" dictType="YesOrNo"  defaultValueCost=" " defaultValue="---"/>
          		</td>
          </tr>
        	</table>
    	</td>
  	</tr>
  	<tr> 
    	<td class="summary_top"></td>
  	</tr>
  	<tr> 
    	<td class="td_center"><a onclick="page_done()"><custom:button type="1" label="L_Finish" imgsrc="finish.gif" border="0" style="width:60"/></a></td>
  	</tr>
	</table>
</form>
</body>
</html>


